package cn.edu.ctbu.datajpa01.service;

import cn.edu.ctbu.datajpa01.domain.Banji;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface BanjiService {

    List<Banji> findAll();

    /**
     * 只分页的查询
     * @param pageable
     * @return
     */
    Page<Banji> findAll(Pageable pageable);

    /**
     * 按id进行查询 @param id 主键，整数
     * @return
     */
    Banji findById(Integer id);

    Banji getById(Integer id);

    Banji insert(Banji banji);

    Banji update(Banji banji);

    void delete(Banji banji);

    void delete(Integer id);


    /**
     * 分页，带过滤的查询
     * @param banji
     * @param pageable
     * @return
     */
    public Page<Banji> findAll(Example<Banji> banji, Pageable pageable);


}
